/*
 * Project: greenline-rms-biz-webservice
 * 
 * File Created at 2013年12月18日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.core.hessian;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.greenline.framework.hessian.HeaderCustomizer;
import com.greenline.hrs.biz.service.hessian.HrsHessianHeader;

/**
 * @Type HrsHeaderCustomizer
 * @Desc 调用hrs必要的header信息
 * @author guoqing.fu
 * @date 2013年12月18日
 * @Version V1.0
 */
public class HrsHeaderCustomizer implements HeaderCustomizer<HrsHessianHeader> {

    private static final String DATE_FORMAT = "yyyyMMddhhmmssSSS";

    @Override
    public void customizeSetting(HrsHessianHeader header) {
        // 生成签名、流水号、请求时间
        SimpleDateFormat sf = new SimpleDateFormat(DATE_FORMAT);
        String dateString = sf.format(new Date());
        // 流水号暂时为日期
        header.setSerialNo(dateString);
        header.setRequestTime(dateString);
    }

}
